package com.kmvc.ui;

import com.kmvc.message.R;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

public class IphoneTitleBarActivity extends Activity 
{
	public TextView leftView;
	protected TextView centerView;//Title中部
	public TextView rightViewText;
	
	protected ImageView rightViewImg;
	private boolean isRightHighlightButton;
	protected TextView rightHighLView;
	
	protected View.OnClickListener onBackListeger = new dxn(this);
	public void setContentView(int paramInt)
	  {
	    requestWindowFeature(7);
	    super.setContentView(paramInt);
	    getWindow().setFeatureInt(7, R.layout.custom_commen_title);
	    init(getIntent());
	  }
	
	private void init(Intent paramIntent)
	  {
		((FrameLayout)findViewById(16908290)).setForeground(getResources().getDrawable(R.drawable.skin_header_bar_shadow));
		if (this.leftView == null)
	    {
			onCreateLeftView();
			onCreateCenterView();
			onCreateRightView();
	    }
	  }
	
	protected View onCreateLeftView()
	  {
		this.leftView = ((TextView)findViewById(R.id.ivTitleBtnLeft));
	    this.leftView.setOnClickListener(this.onBackListeger);
	    //setLayerType(this.leftView);
	    return this.leftView;
	  }
	
	  public View onCreateCenterView()
	  {
		  this.centerView = ((TextView)findViewById(R.id.ivTitleName));
		  return this.centerView;
	  }
	  
	  public View onCreateRightView()
	  {
	    this.rightViewText = ((TextView)findViewById(R.id.ivTitleBtnRightText));
	    this.rightViewImg = ((ImageView)findViewById(R.id.ivTitleBtnRightImage));
	    //setLayerType(this.rightViewText);
	    //setLayerType(this.rightViewImg);
	    return this.rightViewText;
	  }
	  
		 public void setTitle(CharSequence paramCharSequence)
		  {
			 if ((this.centerView != null) && ((this.centerView instanceof TextView)))
			 {
			      this.centerView.setText(paramCharSequence);
			      super.setTitle(paramCharSequence);
			 }
		  }
	  
	  protected void setLeftButton(int paramInt, View.OnClickListener paramOnClickListener)
	  {
	    this.leftView.setVisibility(0);
	    this.leftView.setVisibility(0);
	    this.leftView.setText(paramInt);
	    if (paramOnClickListener == null)
	    {
	      this.leftView.setOnClickListener(this.onBackListeger);
	    }
	    else 
	    {
	    	this.leftView.setOnClickListener(paramOnClickListener);
		}
	  }
	  
	  protected void setRightButton(int paramInt, View.OnClickListener paramOnClickListener)
	  {
	    this.isRightHighlightButton = false;
	    this.rightViewText.setVisibility(0);
	    this.rightViewText.setText(paramInt);
	    this.rightViewText.setEnabled(true);
	    if (paramOnClickListener != null) {
	      this.rightViewText.setOnClickListener(paramOnClickListener);
	    }
	  }
	  
	  protected void enableRightHighlight(boolean paramBoolean)
	  {
	    if ((this.rightHighLView == null) || (!this.isRightHighlightButton)) {
	    	
	    }
	  }
	
	

	 
	 
	 
	 public boolean onBackEvent()
	  {
	    finish();
	    return false;
	  }
	
	
}
